//
//  PersonalView.m
//  inquiry
//
//  Created by 高宇 on 2020/5/28.
//  Copyright © 2020 高宇. All rights reserved.
//

#import "PersonalView.h"
#import "SheelViewController.h"

@interface PersonalView ()
@property (nonatomic,retain)UIView *sheelView;
@end

@implementation PersonalView

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createUI:frame];
    }
    return self;
}

- (void)createUI:(CGRect)frame{
    self.backgroundColor = [UIColor clearColor];
    
    self.button = [UIButton buttonWithType:UIButtonTypeCustom];
    self.button.layer.cornerRadius = 10;
    self.button.frame = CGRectMake(0, 0, frame.size.width, frame.size.height);
    self.button.backgroundColor = [UIColor colorWithRed:248/255.0 green:248/255.0 blue:248/255.0 alpha:1.0];
    [self.button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.button];
    
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(20, 13, 84, 22)];
    self.label.font = [UIFont systemFontOfSize:16];
    self.label.textColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0];
    self.label.text = @"年龄";
    [self addSubview:self.label];
    
    self.mainlabel = [[UILabel alloc] initWithFrame:CGRectMake(104, 13, frame.size.width-130, 22)];
    self.mainlabel.font = [UIFont systemFontOfSize:16];
    self.mainlabel.textColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1.0];
    self.mainlabel.text = @"请选择";
    [self addSubview:self.mainlabel];
    
    self.nextImageView = [[UIImageView alloc] initWithFrame:CGRectMake(frame.size.width-23, 15, 8, 16)];
    self.nextImageView.image = [UIImage imageNamed:@"矩形(4)"];
    [self addSubview:self.nextImageView];
}

- (void)buttonClick:(UIButton *)button{
    if (self.delegate) {
        [self.delegate personalClick:self];
    }
}


@end
